#!/bin/bash

if [ -e target ]; then
	rm -rf target
fi

mkdir target

src_folder=$PWD/src/java
work_folder=$PWD
obj_folder=$PWD/target

# compile
cd $src_folder
javac SimpleAgent.java -d $obj_folder

# run
cd $work_folder
echo "run jconsole"
echo "select SimpleAgent"
java -Dcom.sun.management.jmxremote \
     -Dcom.sun.management.jmxremote.port=1617 \
     -Dcom.sun.management.jmxremote.authenticate=false \
     -Dcom.sun.management.jmxremote.ssl=false \
     -cp target \
     SimpleAgent





